/////////////////////////////////////////////////////////////////////////////
// Name:        sampledialog.cpp
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     23/04/2009 21:57:42
// RCS-ID:      
// Copyright:   
// Licence:     
/////////////////////////////////////////////////////////////////////////////

// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

#ifdef __BORLANDC__
#pragma hdrstop
#endif

#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif

////@begin includes
////@end includes

#include "sampledialog.h"

////@begin XPM images
#include "clock.xpm"
////@end XPM images


/*!
 * SampleDialog type definition
 */

IMPLEMENT_DYNAMIC_CLASS( SampleDialog, wxDialog )


/*!
 * SampleDialog event table definition
 */

BEGIN_EVENT_TABLE( SampleDialog, wxDialog )

////@begin SampleDialog event table entries
////@end SampleDialog event table entries

END_EVENT_TABLE()


/*!
 * SampleDialog constructors
 */

SampleDialog::SampleDialog()
{
    Init();
}

SampleDialog::SampleDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create(parent, id, caption, pos, size, style);
}


/*!
 * SampleDialog creator
 */

bool SampleDialog::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
////@begin SampleDialog creation
    SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
    wxDialog::Create( parent, id, caption, pos, size, style );

    CreateControls();
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end SampleDialog creation
    return true;
}


/*!
 * SampleDialog destructor
 */

SampleDialog::~SampleDialog()
{
////@begin SampleDialog destruction
////@end SampleDialog destruction
}


/*!
 * Member initialisation
 */

void SampleDialog::Init()
{
////@begin SampleDialog member initialisation
////@end SampleDialog member initialisation
}


/*!
 * Control creation for SampleDialog
 */

void SampleDialog::CreateControls()
{    
////@begin SampleDialog content construction
    SampleDialog* itemDialog1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemDialog1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);

    wxNotebook* itemNotebook4 = new wxNotebook( itemDialog1, ID_NOTEBOOK, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT );

    wxPanel* itemPanel5 = new wxPanel( itemNotebook4, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL);
    itemPanel5->SetSizer(itemBoxSizer6);

    wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer6->Add(itemBoxSizer7, 0, wxGROW|wxRIGHT, 5);
    wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer7->Add(itemBoxSizer8, 1, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText9 = new wxStaticText( itemPanel5, wxID_STATIC, _("A &text control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxTextCtrl* itemTextCtrl10 = new wxTextCtrl( itemPanel5, ID_TEXTCTRL, _("Piggywiggywiggy"), wxDefaultPosition, wxSize(140, -1), 0 );
    itemTextCtrl10->SetHelpText(_("The purpose of this control is unclear, but it may possibly be for demo purposes."));
    itemBoxSizer8->Add(itemTextCtrl10, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText11 = new wxStaticText( itemPanel5, wxID_STATIC, _("A &multiline text control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer8->Add(itemStaticText11, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxTextCtrl* itemTextCtrl12 = new wxTextCtrl( itemPanel5, ID_TEXTCTRL1, _("Tom, tom, the piper's son, stole a pig and away he ran."), wxDefaultPosition, wxSize(-1, 60), wxTE_MULTILINE );
    itemTextCtrl12->SetHelpText(_("Use this to type meaningless ditties."));
    itemBoxSizer8->Add(itemTextCtrl12, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText13 = new wxStaticText( itemPanel5, wxID_STATIC, _("A &listbox:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer8->Add(itemStaticText13, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxArrayString itemListBox14Strings;
    itemListBox14Strings.Add(_("First string"));
    itemListBox14Strings.Add(_("Another string"));
    itemListBox14Strings.Add(_("And a final third string"));
    wxListBox* itemListBox14 = new wxListBox( itemPanel5, ID_LISTBOX, wxDefaultPosition, wxSize(-1, 60), itemListBox14Strings, wxLB_SINGLE );
    itemListBox14->SetHelpText(_("This shows a list of uninteresting strings."));
    itemBoxSizer8->Add(itemListBox14, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText15 = new wxStaticText( itemPanel5, wxID_STATIC, _("A &combobox:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer8->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxArrayString itemComboBox16Strings;
    itemComboBox16Strings.Add(_("First string"));
    itemComboBox16Strings.Add(_("Second string"));
    itemComboBox16Strings.Add(_("Third string"));
    itemComboBox16Strings.Add(_("Fourth string"));
    wxComboBox* itemComboBox16 = new wxComboBox( itemPanel5, ID_COMBOBOX, _("Second string"), wxDefaultPosition, wxDefaultSize, itemComboBox16Strings, wxCB_DROPDOWN );
    itemComboBox16->SetStringSelection(_("Second string"));
    itemComboBox16->SetHelpText(_("Test help, to the effect that this combobox can be used to enter a string or select a pre-existing string."));
    itemBoxSizer8->Add(itemComboBox16, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer7->Add(itemBoxSizer17, 0, wxGROW|wxALL, 5);
    wxFlexGridSizer* itemFlexGridSizer18 = new wxFlexGridSizer(2, 3, 0, 0);
    itemBoxSizer17->Add(itemFlexGridSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5);
    wxButton* itemButton19 = new wxButton( itemPanel5, ID_BUTTON, _("Press &Me"), wxDefaultPosition, wxDefaultSize, 0 );
    itemButton19->SetHelpText(_("Press this button for unpredictable results."));
    itemFlexGridSizer18->Add(itemButton19, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxBitmapButton* itemBitmapButton20 = new wxBitmapButton( itemPanel5, ID_BITMAPBUTTON, itemDialog1->GetBitmapResource(wxT("clock.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW );
    itemBitmapButton20->SetHelpText(_("Don't press this, whatever you do."));
    itemFlexGridSizer18->Add(itemBitmapButton20, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxToggleButton* itemToggleButton21 = new wxToggleButton( itemPanel5, ID_TOGGLEBUTTON, _("Toggle"), wxDefaultPosition, wxDefaultSize, 0 );
    itemToggleButton21->SetValue(false);
    itemToggleButton21->SetHelpText(_("Help info for the toggle button."));
    itemFlexGridSizer18->Add(itemToggleButton21, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxCheckBox* itemCheckBox22 = new wxCheckBox( itemPanel5, ID_CHECKBOX1, _("&Binary choice"), wxDefaultPosition, wxDefaultSize, 0 );
    itemCheckBox22->SetValue(false);
    itemCheckBox22->SetHelpText(_("Check this, or not, it's entirely up to you."));
    itemFlexGridSizer18->Add(itemCheckBox22, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxRadioButton* itemRadioButton23 = new wxRadioButton( itemPanel5, ID_RADIOBUTTON, _("&On or off"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
    itemRadioButton23->SetValue(false);
    itemRadioButton23->SetHelpText(_("This radio button doesn't do a lot of anything, least of all tune to BBC Radio 4."));
    itemFlexGridSizer18->Add(itemRadioButton23, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxHyperlinkCtrl* itemHyperlinkCtrl24 = new wxHyperlinkCtrl( itemPanel5, ID_HYPERLINKCTRL, _("www.bbc.co.uk"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
    itemHyperlinkCtrl24->SetHelpText(_("Click on this to go to a fine British institution on the web."));
    itemFlexGridSizer18->Add(itemHyperlinkCtrl24, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);

    wxStaticText* itemStaticText25 = new wxStaticText( itemPanel5, wxID_STATIC, _("A spin control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer17->Add(itemStaticText25, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxSpinCtrl* itemSpinCtrl26 = new wxSpinCtrl( itemPanel5, ID_SPINCTRL, _T("0"), wxDefaultPosition, wxSize(80, -1), wxSP_ARROW_KEYS, 0, 100, 0 );
    itemSpinCtrl26->SetHelpText(_("More spin than the Labour party. OK, perhaps that's not possible."));
    itemBoxSizer17->Add(itemSpinCtrl26, 0, wxALIGN_LEFT|wxALL, 5);

    wxStaticText* itemStaticText27 = new wxStaticText( itemPanel5, wxID_STATIC, _("A slider:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer17->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxSlider* itemSlider28 = new wxSlider( itemPanel5, ID_SLIDER, 0, 0, 100, wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL );
    itemSlider28->SetHelpText(_("A slidy thing from Slidy Land."));
    itemBoxSizer17->Add(itemSlider28, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText29 = new wxStaticText( itemPanel5, wxID_STATIC, _("A search control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer17->Add(itemStaticText29, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxSearchCtrl* itemSearchCtrl30 = new wxSearchCtrl( itemPanel5, ID_SEARCHCTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
    itemSearchCtrl30->SetHelpText(_("Searching in this control will yield untold secrets."));
    itemBoxSizer17->Add(itemSearchCtrl30, 0, wxGROW|wxALL, 5);

    itemNotebook4->AddPage(itemPanel5, _("Basic controls"));

    wxPanel* itemPanel31 = new wxPanel( itemNotebook4, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    wxBoxSizer* itemBoxSizer32 = new wxBoxSizer(wxVERTICAL);
    itemPanel31->SetSizer(itemBoxSizer32);

    wxBoxSizer* itemBoxSizer33 = new wxBoxSizer(wxHORIZONTAL);
    itemBoxSizer32->Add(itemBoxSizer33, 0, wxGROW|wxALL, 5);
    wxBoxSizer* itemBoxSizer34 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer33->Add(itemBoxSizer34, 0, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText35 = new wxStaticText( itemPanel31, wxID_STATIC, _("&HTML window:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer34->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxHtmlWindow* itemHtmlWindow36 = new wxHtmlWindow( itemPanel31, ID_HTMLWINDOW, wxDefaultPosition, wxSize(140, 60), wxHW_SCROLLBAR_AUTO|wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL );
    itemHtmlWindow36->SetPage(_("<html>\n<body>\nHello, this is some <b>HTML markup.</b>\n</body>\n</html>"));
    itemBoxSizer34->Add(itemHtmlWindow36, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText37 = new wxStaticText( itemPanel31, wxID_STATIC, _("Directory control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer34->Add(itemStaticText37, 0, wxALIGN_LEFT|wxALL, 5);

    wxGenericDirCtrl* itemGenericDirCtrl38 = new wxGenericDirCtrl( itemPanel31, ID_DIRCTRL, wxEmptyString, wxDefaultPosition, wxSize(100, 100), 0, _T("All files (*.*)|*.*"), 0 );
    itemBoxSizer34->Add(itemGenericDirCtrl38, 0, wxGROW|wxALL, 5);

    wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer33->Add(itemBoxSizer39, 0, wxGROW|wxALL, 5);
    wxStaticText* itemStaticText40 = new wxStaticText( itemPanel31, wxID_STATIC, _("A rich text control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer39->Add(itemStaticText40, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxRichTextCtrl* itemRichTextCtrl41 = new wxRichTextCtrl( itemPanel31, ID_RICHTEXTCTRL, _("There's not much rich text here."), wxDefaultPosition, wxSize(140, 60), wxWANTS_CHARS );
    itemBoxSizer39->Add(itemRichTextCtrl41, 0, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText42 = new wxStaticText( itemPanel31, wxID_STATIC, _("A tree control:"), wxDefaultPosition, wxDefaultSize, 0 );
    itemBoxSizer39->Add(itemStaticText42, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5);

    wxTreeCtrl* itemTreeCtrl43 = new wxTreeCtrl( itemPanel31, ID_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_SINGLE );
    itemBoxSizer39->Add(itemTreeCtrl43, 0, wxGROW|wxALL, 5);

    itemNotebook4->AddPage(itemPanel31, _("Advanced controls"));

    itemBoxSizer3->Add(itemNotebook4, 0, wxGROW|wxALL, 5);

    wxStdDialogButtonSizer* itemStdDialogButtonSizer44 = new wxStdDialogButtonSizer;

    itemBoxSizer3->Add(itemStdDialogButtonSizer44, 0, wxGROW|wxALL, 5);
    wxButton* itemButton45 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
    itemButton45->SetHelpText(_("You probably know what an OK button does by now."));
    itemStdDialogButtonSizer44->AddButton(itemButton45);

    wxButton* itemButton46 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    itemButton46->SetHelpText(_("Click to stop doing what you thought this dialog was going to do."));
    itemStdDialogButtonSizer44->AddButton(itemButton46);

    itemStdDialogButtonSizer44->Realize();

////@end SampleDialog content construction

    itemTextCtrl10->SetFocus();

    m_adapter.Adapt(this);
}


/*!
 * Should we show tooltips?
 */

bool SampleDialog::ShowToolTips()
{
    return true;
}

/*!
 * Get bitmap resources
 */

wxBitmap SampleDialog::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin SampleDialog bitmap retrieval
    wxUnusedVar(name);
    if (name == _T("clock.xpm"))
    {
        wxBitmap bitmap( clock_xpm);
        return bitmap;
    }
    return wxNullBitmap;
////@end SampleDialog bitmap retrieval
}

/*!
 * Get icon resources
 */

wxIcon SampleDialog::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin SampleDialog icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end SampleDialog icon retrieval
}
